﻿namespace HuaWei
{
    using System;
    using System.ServiceModel;
    using System.ServiceModel.Channels;

    internal static class SysManager
    {
        private static bool isWirte;

        static SysManager()
        {
            isWirte = true;
        }

        public static string GetClientIP()
        {
            RemoteEndpointMessageProperty property = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            return property.Address;
        }

        public static void WriteLog(string msg)
        {
            if (isWirte)
            {
                Log.Write(msg);
            }
        }
    }
}

